//
//  AppListTabBarViewController.m
//  LittleSugar
//
//  Created by zhang on 15-6-13.
//  Copyright (c) 2015年 张鑫. All rights reserved.
//

#import "AppListTabBarViewController.h"
#import "AppListViewController.h"

@interface AppListTabBarViewController ()

@end

@implementation AppListTabBarViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self creatViewControllers];
}

- (void)creatViewControllers {
    NSString *path = [[NSBundle mainBundle] pathForResource:@"Controllers" ofType:@"plist"];
    NSArray *arr = [NSArray arrayWithContentsOfFile:path];
    NSArray *urls = @[kHomeUrl,kCategoryUrl];
    NSMutableArray *vcArr = [[NSMutableArray alloc] init];
    for (NSInteger i = 0; i < arr.count; i++) {
        NSDictionary *dict = arr[i];
        Class cls =  NSClassFromString(dict[@"className"]);
        AppListViewController *app = [[cls alloc] init];
        UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:app];
        app.title = dict[@"title"];
        self.tabBar.tintColor = [UIColor colorWithRed:255/255.0f green:153/255.0f blue:153/255.0f alpha:1];
        nav.tabBarItem.image = [UIImage imageNamed:dict[@"iconName"]];
       // app.requestUrl = urls[i];
        [vcArr addObject:nav];
    }
    self.viewControllers = vcArr;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
